 /**
 * 管理员登录页面
 * 2017-11-16
 * wangweiruning
 * **/
 
 $(function () {
            $("#msg").hide();
            $("#login_in").click(function () { 
            	var phono=$("#use_id").val();
            	var pwd=$("#use_psd").val();
            	sessionStorage.setItem("phone",phono);

            	
            	$.ajax({
		           	type:"post",
		           	url:"https://jindi163.com:8443/JDLot/admin/user/login1",
		           	 dataType:"json",
            		contentType:"application/json",
            		xhrFields: {
   						 withCredentials: true
						},
					crossDomain: true,
		        	data:{
		           	"password":pwd,
		           	"username":phono
		           },
		           success:function(res){
//		           var	res=JSON.stringify(res);
//					var res=eval('('+res+')');	
//					var res=JSON.parse(res);
					console.log(res)
							
							var pers= res.permissions;
							sessionStorage.setItem("pers",pers);
							var items=sessionStorage.getItem("pers");
							
							
		           		if (res.status==1) {
            			window.location.href="index.html";
            		} else{
            				$("#msg").slideDown(1000, close);   //3秒时间显示弹框后调用close函数 
				           	function close() {
           						 setTimeout(function () {
                					$("#msg").slideUp();   //3秒后隐藏弹框
           							 }, 1000); 
				           }
            		} 
		        
		           },
		           error:function(error){
		           alert("数据请求失败!")
		           }
   
                })
            })
  $("#login_inss").click(function(){
   $.ajax({
		           	type:"post",
		           	url:"https://jindi163.com:8443/JDLot/admin/paynum/total",
		           	dataType:"json",
            		contentType:"application/json",
		        	async:true,
		        	xhrFields: {
   						 withCredentials: true
						},
					crossDomain: true,
		           success:function(data){
		           			 	console.log(data)
		           			 }
       })
})
 })